<template>
    <div class="dischargeport">
        <el-table ref="carNosTable" :data="data" border highlight-current-row max-height="180" @row-click="dClick" class="table-list" @selection-change="handleSelectionChange">
            <el-table-column type="selection" width="55"></el-table-column>
            <el-table-column prop="containerNo" label="箱号"></el-table-column>
        </el-table>
    </div>
</template>
<script>
export default {
    name: 'OpenNos',
    props: ['data', 'sdata'],
    data () {
        return {
            tData: []
        }
    },
    mounted () {
        for (var i = 0; i < this.data.length; i++) {
            for (var j = 0; j < this.sdata.length; j++) {
                if (this.sdata[j] == this.data[i].containerNo) {
                    this.$refs.carNosTable.toggleRowSelection(this.data[i], true)
                    // this.tData.push(this.data[i]);
                }
            }
        }
        // this.$emit('getValue',this.tData)
    },
    methods: {
        dClick (row) {
            this.$refs.carNosTable.toggleRowSelection(row, true)
        },
        handleSelectionChange (val) {
            this.tData = val
            this.$emit('getValue', this.tData)
        }

    }
}
</script>
<style lang="less"  scoped>
.dischargeport{
    .content-footer{
    margin-top: 10px;
    float:right;
    }

}
.h30{
    height:30px;
    line-height: 20px;
    color:#000;
}
.red{
    color:red;
}

</style>
